package com.iwayin.web.action.task;

import java.util.List;

import com.iwayin.core.bo.ask.AskBO;
import com.iwayin.core.bo.task.DayHotAskTaskBO;
import com.iwayin.core.bo.user.UserBO;
import com.iwayin.core.dataobject.AskDO;
import com.iwayin.core.dataobject.UserDO;
import com.iwayin.web.action.BaseAction;
import com.iwayin.web.common.AjaxResult;

/**
 * 发送每日参与最多的问问
 * @author harry
 *
 */
public class DayHotAskTaskAction extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 4347002576648378205L;
	
	private UserBO userBO;
	
	private AskBO askBO;
	
	private DayHotAskTaskBO dayHotAskTaskBO;
	
	private AjaxResult ajaxResult;
	
	
	public String sendTop5Email() {
		List<UserDO> receivers = userBO.findCanSendEmail();
		dayHotAskTaskBO.sendTopVote5AskEmail(receivers, askBO.findTop5VoteOrLikeAsk("vote_count"));
		dayHotAskTaskBO.sendTopLike5AskEmail(receivers, askBO.findTop5VoteOrLikeAsk("like_count"));
		ajaxResult = AjaxResult.succResult();
		return SUCCESS;
	}

	public void setUserBO(UserBO userBO) {
		this.userBO = userBO;
	}

	public void setAskBO(AskBO askBO) {
		this.askBO = askBO;
	}

	public AjaxResult getAjaxResult() {
		return ajaxResult;
	}

	public void setAjaxResult(AjaxResult ajaxResult) {
		this.ajaxResult = ajaxResult;
	}

	public void setDayHotAskTaskBO(DayHotAskTaskBO dayHotAskTaskBO) {
		this.dayHotAskTaskBO = dayHotAskTaskBO;
	}

}
